package web.services;

import bean.SuccessfulNews;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import web.dao.HomeDao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/7/1.
 */
@Service
public class HomeService {

    @Autowired
    private HomeDao homeDao;

    @Autowired
    private SearchService searchService;

//  通过districtNewsId获取信息
    private static Map<String,Map<String,Object>> mapNews=new HashMap<String, Map<String, Object>>();

//  中标公司联系方式
    private static Map<String,Map<String,Object>> mapSuccessContact=new HashMap<String, Map<String, Object>>();


    public Map<String,Object> findTenderMap(String districtNewsId,String province){
        if(province.equals("0")){
            province="100000";
        }
        if(mapNews.get(districtNewsId)==null){
            if(mapNews.size()>1000000){
                mapNews.clear();
            }
            mapNews.put(districtNewsId,homeDao.findNewsByDistrict(districtNewsId,province));
        }
        return mapNews.get(districtNewsId);
    }




}
